﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;

namespace MonitorAgent
{
   public partial class MonitorAgent : ServiceBase
   {
      public MonitorAgent()
      {
         InitializeComponent();
         if (!System.Diagnostics.EventLog.SourceExists("eventLogSourceMA"))
         {
            System.Diagnostics.EventLog.CreateEventSource(
                "eventLogSourceMA", "MonitorAgentLog");
         }
         eventLogMonitorAgent.Source = "eventLogSourceMA";
         eventLogMonitorAgent.Log = "MonitorAgentLog";
      }

      protected override void OnStart(string[] args)
      {
         eventLogMonitorAgent.WriteEntry("In OnStart");
      }

      protected override void OnStop()
      {
         eventLogMonitorAgent.WriteEntry("In OnStop");
      }
   }
}
